<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title></title>
  <style type="text/css">
    body,
    ul,
    li {
      margin: 0;
      padding: 0;
      list-style: none;
    }

    body,
    html {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
    }

    .center {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
    }

    .box {
      background-color: aqua;
      width: 80%;
      height: 80%;
    }

    .box-1 {
      background-color: blueviolet;
      width: 80%;
      height: 80%;
    }

    .box-2 {
      background-color: red;
      width: 80%;
      height: 80%;
    }
  </style>
</head>

<body>
  <div class="box center">
    <div class="box-1 center">
      <div class="box-2 center">

      </div>
    </div>
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <script>
      let box = getElementByClass('box')
      box.addEventListener('click',(e)=>{
        // e.stopPropagation()
        e.preventDefault()
        console.log('box')
      },true)
      let box_1 = getElementByClass('box-1')
      box_1.addEventListener('click',()=>{
        console.log('box_1')
      },true)
      let box_2 = getElementByClass('box-2')
      box_2.addEventListener('click',()=>{
        console.log('box_2')
      },true)
      let body = document.querySelector('body')
      body.addEventListener('click',()=>{
        console.log('body----')
      },true)
      console.dir(box)
      function getElementByClass(classStr) {
        return document.getElementsByClassName(classStr)[0]
      }
      var promise =  new Promise((resolve,reject)=>{
        console.log('new Promise的时候执行')
        setTimeout(()=>{
          resolve('success')
        },1500)
      })
      promise.then(res=>{
        console.log(res)
      })
  </script>
  <script>
    // console.log(axios.get())
    let url_1 = 'https://ssp-api.jinbig.cn/bidding/bxm'
    // var reqData = { "device": { "os": "android", "os_version": "10.0.1", "model": "Redmi 4A", "make": "Xiaomi", "brand": "Xiaomi", "ua": "Mozilla\/5.0 (Linux; Android 10.0.1; Redmi 4A Build \/MMB29M; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.Chrome\/57.0.2987.132 Mobile Safari\/537.36", "android_id_md5": "", "imei_md5": "e8ce0c561fc109cf05bf67e419f7254", "idfa_md5": "", "oaid": "", "orientation": 1, "connection_type": "wifi" }, "app": { "id": "2c586f2cd0ed4ca4814b722484f8ac56", "bundle": "com.wuba", "name": "58同城", "ver": "1.0.0" }, "ads": [{ "place_token": "802383002011" }], "ver": "3.3.4" }
    var reqData = '{ "device": { "os": "android", "os_version": "10.0.1", "model": "Redmi 4A", "make": "Xiaomi", "brand": "Xiaomi", "ua": "Mozilla\/5.0 (Linux; Android 10.0.1; Redmi 4A Build \/MMB29M; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.Chrome\/57.0.2987.132 Mobile Safari\/537.36", "android_id_md5": "", "imei_md5": "e8ce0c561fc109cf05bf67e419f7254", "idfa_md5": "", "oaid": "", "orientation": 1, "connection_type": "wifi" }, "app": { "id": "2c586f2cd0ed4ca4814b722484f8ac56", "bundle": "com.wuba", "name": "58同城", "ver": "1.0.0" }, "ads": [{ "place_token": "802383002011" }], "ver": "3.3.4" }'
    // axios.post(url_1,reqData).then(res=>{
    //   console.log('res',res)
    // }).catch(err=>{
    //   console.log('err',err)
    // })
    
    
    // var xmlhttp;
    // if (window.XMLHttpRequest) {
    //   //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
    //   xmlhttp = new XMLHttpRequest();
    // }
    // else {
    //   // IE6, IE5 浏览器执行代码
    //   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    // }
    // xmlhttp.open("GET", url_1, true);
    // xmlhttp.setRequestHeader("Content-type", "application/json");
    // xmlhttp.send(reqData);

    $.ajax({
      type: "POST",
      url: url_1,
      data: reqData,
      contentType:"json/application",
      dataType: "json",
      success: function (data) {
        console.log(data)
      }
    });
  </script>
</body>